<div class="fsh-rightPanel">
    <div class="layui-anim layui-anim-upbit">
        <div class="layui-form-item wx-search" id="list_form">
            <div class="layui-inline">
                <label>
                    <input type="text" name="schoolName" placeholder="请输入学校名称" autocomplete="off" class="layui-input">
                </label>
            </div>
            <button class="layui-btn" id="search2">搜索</button>
        </div>
        <table id="schoolTable" class="layui-hide" lay-filter="schoolTable"></table>
    </div>
</div>

<script>
    layui.use(['layer', 'table'], function () {
        var layer = layui.layer;
        var table = layui.table;
        var form = layui.form;

        var tableObj = table.render({
            elem: '#schoolTable',
            url: context + '/api/school/getList',
            request: {
                limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            align: 'center'
            , cols: [[ //表头
                {type: 'checkbox', fixed: 'left'},
                {
                    field: 'logo', title: 'LOGO', align: 'center', templet: function (d) {
                        return d.logo !== undefined ? '<div><img src="' + d.logo + '" style="height:100px;width:100px;" alt=""/></div>' : '';
                    }
                },
                {field: 'code', title: '学校编号', align: 'center'},
                {field: 'schoolName', title: '学校名称', align: 'center'},
                {field: 'location', title: '所属城市', align: 'center'},
                {field: 'department', title: '所属部门', align: 'center'},
                {field: 'level', title: '类别', align: 'center'},
                {field: 'createDate', title: '创建日期', align: 'center'},
            ]]
            , page: true
        });

        // 检索
        $("#search2").click(function () {
            reloadTable(tableObj);
        });
    });
</script>
